#!/bin/bash
###install redis  extend #########
cd /usr/local/src
wget http://pecl.php.net/get/redis-2.2.7.tgz
tar fxvz redis-2.2.7.tgz
cd redis-2.2.7
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
echo 'extension=redis.so' >> /usr/local/php/etc/php.ini
service php-fpm restart
service nginx restart


###install amqp  extend #########
cd /usr/local/src
wget https://github.com/alanxz/rabbitmq-c/releases/download/v0.5.2/rabbitmq-c-0.5.2.tar.gz
tar fxvz rabbitmq-c-0.5.2.tar.gz
cd rabbitmq-c-0.5.2
autoreconf -i
./configure
make  &&  make install

cd /usr/local/src
wget http://pecl.php.net/get/amqp-1.0.9.tgz
tar -zxvf amqp-1.0.9.tgz
cd amqp-1.0.9
/usr/local/php/bin/phpize 
./configure --with-php-config=/usr/local/php/bin/php-config --with-amqp
make  &&  make install
echo 'extension=amqp.so' >> /usr/local/php/etc/php.ini
service php-fpm restart
service nginx restart


###install mongo extend #########
cd /usr/local/src
wget http://pecl.php.net/get/mongo-1.6.11.tgz
tar fxvz mongo-1.6.11.tgz
cd mongo-1.6.11
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
echo 'extension=mongo.so' >> /usr/local/php/etc/php.ini




